      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          <ol class="breadcrumb">
            <li><a href="<?=site_url()?>/product/index">商品管理</a></li>
            <li class="active">补货中商品</li>
          </ol>
          <div class="row">
            <div class="col-md-12">
              <div class="table-responsive">
                <h4 class="margin-bottom-15">补货中商品记录</h4>
                <table class="table table-striped table-hover table-bordered">
                  <thead>
                    <tr>
                      <th>ID</th>
                      <th>商品名称</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                  	<?php foreach ($shorts as $item):?>
                    <tr>
                      <td><?php echo $item['id'];?></td>
                      <td><?php echo $item['name'];?></td>
                      <td>
							<a href="" class="btn btn-link provide" data-id="<?php echo $item['id'];?>"  >供应</a>
                      </td>
                    </tr>
                     <?php endforeach;?>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
           <div class="pagination">
            <?php echo $links ;?>
          </div>
        </div>
      </div>
       <script>
	$(document).ready(function() {
		$(".provide").click(function() {
			if(confirm("确定要供应吗？"))
			{
			var productid = $(this).attr("data-id");
			$.ajax({
				url : '<?php echo site_url('product/setproductshort')?>',
				type : "post",
				async : false,
				data : {
					'productid' : productid,
					'state':0
				},
				dataType : "json",
				success : function(data) {
					if(data.code)
					{
						alert(data.msg);
						window.location.reload();
					}else{
						alert(data.msg);
					}
				}
			});
			}
			
		});
	}); 
</script>